import { createParamDecorator } from '@nestjs/common';

export const User = createParamDecorator(
    // (data, [root, args, { req }]) => req.user,
    (data, ctx) => {
        const args = ctx.getArgs()
        const [root, arg, { req }] = args
        // console.log(ctx.switchToHttp().getRequest())
        // console.log(ctx.switchToWs().getClient())
        // const request = ctx.switchToHttp().getRequest();
        return req.user;
    },
);
